﻿<!DOCTYPE html>
<html>
<!-- 年度培训计划管理-编辑2 -->

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>
    <style>
        .vue-treeselect__control {
            height: 100%;
            border: none;
            background: none;
        }

        .vue-treeselect__placeholder {
            top: -3px;
        }

        .vue-treeselect__single-value {
            top: -3px;
        }

        .el-input__suffix {
            /* z-index: 9; */
        }
    </style>
</head>

<body>
    <div id="app" class="popupW100" v-cloak>
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
                 size="mini">
            <el-row>
                <el-col :span="24">
                    <!--培训计划名称-->
                    <div class="elst-select-mini">
                        <el-form-item prop="nameoftrainingplan">
                            <el-input type="text" v-model="Form.nameoftrainingplan" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{AnnualTrainingPlanManagement.Nameoftrainingplan+mark.m}}
                                </template>
                            </el-input>
                            <span class="iputLineMust" v-if="!Form.nameoftrainingplan">
                                <img src="/static/images/exclamation.png" alt="">
                            </span>

                        </el-form-item>
                    </div>
                </el-col>
                <!--培训开始时间-->
                <el-col :span="11">
                    <el-form-item prop="trainingdate">
                        <div class="elst-select-mini" style="margin-left: -0px;">
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{AnnualTrainingPlanManagement.TrainingdateStart+mark.m}}
                                </template>
                                <el-date-picker slot="suffix" v-model="Form.trainingdate" type="date" size="mini"
                                                format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择日期">
                                </el-date-picker>
                            </el-input>
                            <span class="iputLineMust" v-if="!Form.trainingdate">
                                <img src="/static/images/exclamation.png" alt="">
                            </span>
                        </div>
                    </el-form-item>
                </el-col>
                <!--培训结束时间-->
                <el-col :span="11" offset="2">
                    <el-form-item prop="endDate">
                        <div class="elst-select-mini" style="margin-left: -0px;">
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{AnnualTrainingPlanManagement.TrainingdateEnd+mark.m}}
                                </template>
                                <el-date-picker slot="suffix" v-model="Form.endDate" type="date" size="mini"
                                                format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择日期">
                                </el-date-picker>
                            </el-input>
                            <span class="iputLineMust" v-if="!Form.endDate">
                                <img src="/static/images/exclamation.png" alt="">
                            </span>
                        </div>
                    </el-form-item>
                </el-col>

                <!--培训地点-->
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item prop="trainingvenue">
                            <el-input type="text" v-model="Form.trainingvenue" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{AnnualTrainingPlanManagement.Trainingvenue+mark.m}}
                                </template>
                            </el-input>
                            <span class="iputLineMust" v-if="!Form.trainingvenue">
                                <img src="/static/images/exclamation.png" alt="">
                            </span>
                        </el-form-item>
                    </div>
                </el-col>
                <!--培训类型-->
                <el-col :span="11" offset="2">
                    <div class="elst-select-mini">
                        <el-form-item size="mini" prop="trainingmode">
                            <el-input>
                                <template slot="prepend">
                                    {{AnnualTrainingPlanManagement.Trainingtype+mark.m}}
                                </template>
                                <el-select @visible-change="visibleChange" v-model="Form.trainingmode" slot="suffix"
                                           :placeholder="AnnualTrainingPlanManagement.Trainingtype">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in TrainingtypeL" :label="item.value" :value="item.key">
                                    </el-option>
                                </el-select>
                            </el-input>
                            <span class="iputLineMust" v-if="!Form.trainingmode">
                                <img src="/static/images/exclamation.png" alt="">
                            </span>
                        </el-form-item>
                    </div>
                </el-col>
                <!--培训讲师-->
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item prop="trainingteacher">
                            <div class="el-input--mini el-input-group">
                                <div class="el-input-group__prepend">
                                    {{'培训讲师'+mark.m}}
                                </div>
                                <tree-doubledepartment-staff-single class="el-textarea__inner" v-model="Form.trainingteacher"
                                                              slot="suffix" style="line-height:28px;" placeholder="请选择" />
                              
                                <span class="iputLineMust" v-if="!Form.trainingteacher">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </div>
                        </el-form-item>
                        <!--<el-form-item prop="trainingteacher">
                    <el-input type="text" v-model="Form.trainingteacher" autocomplete="off" size="mini">
                        <template slot="prepend">
                            {{AnnualTrainingPlanManagement.Trainingteacher+mark.m}}
                        </template>
                    </el-input>
                </el-form-item>-->
                    </div>
                </el-col>
                <!--<el-col :span="2" class="ml10">
            <el-button @click=addTeacher() class="fl">{{col.Choose}}</el-button>
        </el-col>
        <el-col :span="11">
        </el-col>-->
                <!--培训内容-->
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="trainingcontents">
                            <div class="el-input--mini el-input-group">
                                <div class="el-input-group__prepend">
                                    {{AnnualTrainingPlanManagement.Trainingcontents+mark.m}}
                                </div>
                                <el-input class="el-textarea__inner" type="textarea" v-model="Form.trainingcontents"
                                          autocomplete="off"></el-input>

                            </div>
                            <span class="iputLineMust" v-if="!Form.trainingcontents">
                                <img src="/static/images/exclamation.png" alt="">
                            </span>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col class="head-tool">
                    培训目标
                </el-col>
                <!--培训目标--总部课件ID-->
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item prop="zbCourseId">
                            <el-input size="mini">
                                <template slot="prepend">
                                    <div> {{AnnualTrainingPlanManagement.Trainingobjectives+mark.m}}</div>
                                </template>
                                <el-select @visible-change="visibleChange" v-model="Form.zbCourseId" slot="suffix" @change="ChangeOne"
                                           :placeholder="AnnualTrainingPlanManagement.Trainingobjectives">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in TrainingobjectivesL" :label="item.topicname" :value="item.id">
                                    </el-option>
                                </el-select>
                            </el-input>
                            <span class="iputLineMust" v-if="!Form.zbCourseId">
                                <img src="/static/images/exclamation.png" alt="">
                            </span>
                        </el-form-item>
                    </div>
                </el-col>

            </el-row>
            <el-row>
                <el-col class="head-tool">
                    考试信息
                </el-col>
                <!--难易度-->
                <!--<el-col :span="11">
            <el-col>
                <div class="elst-select-mini">
                    <el-form-item>
                        <el-input size="mini">
                            <template slot="prepend">
                                <div> {{AnnualTrainingPlanManagement.facilityvalue+mark.m}}</div>
                            </template>
                            <el-select v-model="Form.facilityvalue" slot="suffix"
                                       :placeholder="AnnualTrainingPlanManagement.facilityvalue">
                                <el-option label="请选择" value=""></el-option>
                                <el-option v-for="item in facilityvalueL" :label="item.value" :value="item.key">
                                </el-option>
                            </el-select>
                        </el-input>
                    </el-form-item>
                </div>
            </el-col>
        </el-col>-->
                <!--考试方式-->
                <el-col :span="11">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item prop="examinationmethods">
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div> {{AnnualTrainingPlanManagement.Examinationmethods+mark.m}}</div>
                                    </template>
                                    <el-select v-model="Form.examinationmethods" slot="suffix" @change="onchange"
                                               :placeholder="AnnualTrainingPlanManagement.Examinationmethods">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in ExaminationmethodsL" :label="item.value"
                                                   :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                                <span class="iputLineMust" v-if="!Form.examinationmethods">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
                <!--题型-->
                <!--<el-col :span="11" offset="2">
            <el-col>
                <div class="elst-select-mini">
                    <el-form-item prop="questiontype">
                        <el-input size="mini">
                            <template slot="prepend">
                                <div> {{AnnualTrainingPlanManagement.Questiontype+mark.m}}</div>
                            </template>
                            <el-select v-model="Form.questiontype" slot="suffix"
                                       :placeholder="AnnualTrainingPlanManagement.Questiontype">
                                <el-option label="请选择" value=""></el-option>
                                <el-option v-for="item in QuestiontypeL" :label="item.value" :value="item.key">
                                </el-option>
                            </el-select>
                        </el-input>
                        <span class="iputLineMust" v-if="!Form.questiontype">
                            <img src="/static/images/exclamation.png" alt="">
                        </span>
                    </el-form-item>
                </div>
            </el-col>
        </el-col>-->

            </el-row>
            <div v-show="visible">
                <el-row>
                    <!--满分-->
                    <el-col :span="11">
                        <div class="elst-select-mini">
                            <el-form-item prop="fullmarks">
                                <el-input type="text" v-model="Form.fullmarks" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{AnnualTrainingPlanManagement.Fullmarks+mark.m}}
                                    </template>
                                </el-input>
                                <span class="iputLineMust" v-if="!Form.fullmarks">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </el-form-item>
                        </div>
                    </el-col>
                    <!--合格分数-->
                    <el-col :span="11" offset="2">
                        <div class="elst-select-mini">
                            <el-form-item prop="qualificationscore">
                                <el-input type="text" v-model="Form.qualificationscore" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{AnnualTrainingPlanManagement.Qualificationscore+mark.m}}
                                    </template>
                                </el-input>
                                <span class="iputLineMust" v-if="!Form.qualificationscore">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </el-form-item>
                        </div>
                    </el-col>
                    <!--判断题-->
                    <el-col :span="11">
                        <div class="elst-select-mini">
                            <el-form-item prop="judgmentNumber">
                                <el-input type="text" v-model="Form.judgmentNumber" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{AnnualTrainingPlanManagement.JudgmentQuestion+mark.m}}
                                    </template>
                                </el-input>
                                <span class="iputLineMust" v-if="!Form.judgmentNumber">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </el-form-item>
                        </div>
                    </el-col>
                    <!--判断题每题分数-->
                    <el-col :span="11" offset="2">
                        <div class="elst-select-mini">
                            <el-form-item prop="judgmentScore">
                                <el-input type="text" v-model="Form.judgmentScore" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{AnnualTrainingPlanManagement.Scoresforeachquestion1+mark.m}}
                                    </template>
                                </el-input>
                                <span class="iputLineMust" v-if="!Form.judgmentScore">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </el-form-item>
                        </div>
                    </el-col>
                    <!--单选题-->
                    <el-col :span="11">
                        <div class="elst-select-mini">
                            <el-form-item prop="singleNumber">
                                <el-input type="text" v-model="Form.singleNumber" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{AnnualTrainingPlanManagement.Singlechoicetopic+mark.m}}
                                    </template>
                                </el-input>
                                <span class="iputLineMust" v-if="!Form.singleNumber">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </el-form-item>
                        </div>
                    </el-col>
                    <!--单选题每题分数-->
                    <el-col :span="11" offset="2">
                        <div class="elst-select-mini">
                            <el-form-item prop="singleScore">
                                <el-input type="text" v-model="Form.singleScore" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{AnnualTrainingPlanManagement.Scoresforeachquestion2+mark.m}}
                                    </template>
                                </el-input>
                                <span class="iputLineMust" v-if="!Form.singleScore">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </el-form-item>
                        </div>
                    </el-col>
                    <!--多选题-->
                    <el-col :span="11">
                        <div class="elst-select-mini">
                            <el-form-item prop="multipleNumber">
                                <el-input type="text" v-model="Form.multipleNumber" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{AnnualTrainingPlanManagement.Multipletopics+mark.m}}
                                    </template>
                                </el-input>
                                <span class="iputLineMust" v-if="!Form.multipleNumber">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </el-form-item>
                        </div>
                    </el-col>
                    <!--多选题每题分数-->
                    <el-col :span="11" offset="2">
                        <div class="elst-select-mini">
                            <el-form-item prop="multipleScore">
                                <el-input type="text" v-model="Form.multipleScore" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{AnnualTrainingPlanManagement.Scoresforeachquestion3+mark.m}}
                                    </template>
                                </el-input>
                                <span class="iputLineMust" v-if="!Form.multipleScore">
                                    <img src="/static/images/exclamation.png" alt="">
                                </span>
                            </el-form-item>
                        </div>
                    </el-col>
                    <!--考试开始时间-->
                    <!--<el-col :span="11">
                <el-form-item  prop="examinationstarttime">
                    <div class="elst-select-mini" style="margin-left: -0px">
                        <el-input size="mini">
                            <template slot="prepend">
                                {{AnnualTrainingPlanManagement.Examinationstarttime+mark.m}}
                            </template>
                            <el-date-picker slot="suffix" v-model="Form.examinationstarttime" type="date"
                                            size="mini" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择时间">
                            </el-date-picker>
                        </el-input>
                    </div>
                </el-form-item>
            </el-col>-->
                    <!--考试结束时间-->
                    <!--<el-col :span="11" offset="2">
                <el-form-item  prop="endtimeofexamination">
                    <div class="elst-select-mini" style="margin-left: -0px">
                        <el-input size="mini">
                            <template slot="prepend">
                                {{AnnualTrainingPlanManagement.Endtimeofexamination+mark.m}}
                            </template>
                            <el-date-picker slot="suffix" v-model="Form.endtimeofexamination" type="date"
                                            size="mini" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择时间">
                            </el-date-picker>
                        </el-input>
                    </div>
                </el-form-item>
            </el-col>-->


                </el-row>
            </div>
            <br>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <!--<el-button @click="onSubmitForm('ruleForm')" type="primary" class="fl">{{col.btnSave}}</el-button>-->
                    <el-button @click="onSubmitForm('ruleForm')" type="primary" class="fl">{{col.btnCommit}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    <el-dialog title="年度培训计划管理-选择培训老师" fullscreen="true" :visible.sync="ListItem.dialogVisible" @close='closeDialog'
               width="80%" height="80%" top="10vh">
        <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
    </el-dialog>
    </div>
    <script type="text/javascript">

        var app = new Vue({

            el: '#app',
            data: {
                pageInitial: null,
                //父业传参
                id: '',
                visible: true,
                value1: '',
                ListItem: ListItem,
                TrainingtypeL: [],//培训类型
                TrainingobjectivesL: [],//培训目标_来自课件

                facilityvalueL: [],//难易度
                QuestiontypeL: [],  //题型
                ExaminationmethodsL: [],//考试方式

                formInline: {
                    model: {
                        // employeename: '', trainingdate: '', trainingtype: '', trainingteacher: ''
                        // , nameoftrainingplan: '', trainingvenue: '', trainingobjectives: '', trainingmode: ''
                        zbCourseId: '', sktid: '', trainingteacher: ''
                    },
                    offset: 0,
                    limit: 10
                },
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    nameoftrainingplan: '',//培训计划名称
                    trainingdate: '',    //培训开始时间
                    year:'',
                    endDate: '',        //培训结束时间
                    trainingvenue: '',  //培训地点
                    trainingmode: '',  //培训类型
                    trainingteacher: null, //培训讲师
                    trainingcontents: '', //培训内容
                    state: '',
                    zbCourseId: '', //课题id 培训目标--总部课件ID

                    examinationmethods: '', //考试方式
                    questiontype: '',  //题型

                    fullmarks: '0',  //满分
                    qualificationscore: '0',  //合格分数

                    judgmentNumber: '0',  //判断题
                    judgmentScore: '0',  //判断题每题分数
                    singleNumber: '0',  //单选题
                    singleScore: '0',  //单选题每题分数
                    multipleNumber: '0',  //多选题
                    multipleScore: '0',  //多选题每题分数

                    tsingleNumber: '0',  //单选题_临时
                    tmultipleNumber: '0',  //多选题_临时
                    tjudgmentNumber: '0',  //判断题_临时

                    selid: [],
                    zB_TrainPlanQuestions: [],
                    mzbTrainPlanId: '',
                    trainPlanQuestionidl: []

                },
                //表单验证
                rules: {
                    //培训计划名称
                    nameoftrainingplan: [
                        verification.NotNull

                    ],
                    //培训开始时间
                    trainingdate: [
                        verification.NotNullSelect
                    ],
                    //培训结束时间
                    endDate: [
                        verification.NotNull
                    ],
                    //培训地点
                    trainingvenue: [
                        verification.NotNull,
                    ],
                    //培训类型
                    trainingmode: [
                        verification.NotNull
                    ],
                    //培训讲师
                    trainingteacher: [
                        verification.NotNull
                    ],
                    //培训内容
                    trainingcontents: [
                        verification.NotNull
                    ],

                    //课题id 培训目标--总部课件ID
                    zbCourseId: [
                        verification.NotNull
                    ],

                    //考试方式
                    examinationmethods: [
                        verification.NotNull
                    ],
                    ////题型
                    //questiontype: [
                    //    verification.NotNull
                    //],
                    //满分
                    fullmarks: [
                        verification.NotNull,
                        { pattern: verification.IsDecimal.t, message: verification.IsDecimal.m }

                    ],
                    //合格分数
                    qualificationscore: [
                        verification.NotNull,
                        { pattern: verification.IsDecimal.t, message: verification.IsDecimal.m }
                    ],
                    //判断题
                    judgmentNumber: [
                        verification.NotNull,
                        { pattern: verification.IsDecimal.t, message: verification.IsDecimal.m }
                    ],
                    //判断题每题分数
                    judgmentScore: [
                        verification.NotNull,
                        { pattern: verification.IsDecimal.t, message: verification.IsDecimal.m }
                    ],
                    //单选题
                    singleNumber: [
                        verification.NotNull,
                        { pattern: verification.IsDecimal.t, message: verification.IsDecimal.m }
                    ],
                    //单选题每题分数
                    singleScore: [
                        verification.NotNull,
                        { pattern: verification.IsDecimal.t, message: verification.IsDecimal.m }
                    ],
                    //多选题
                    multipleNumber: [
                        verification.NotNull,
                        { pattern: verification.IsDecimal.t, message: verification.IsDecimal.m }
                    ],
                    //多选题每题分数
                    multipleScore: [
                        verification.NotNull,
                        { pattern: verification.IsDecimal.t, message: verification.IsDecimal.m }
                    ],


                }
            },

            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                addTeacher: function (val, id) { DialogShow(this, val, "AnnualTrainingPlanManagementInputAddTeacher.html", id); },

                onchange: function (val) {

                    if (val != "" && val == 1)
                        this.visible = true;
                    else
                        this.visible = false;

                },
                //获取分页数据
                GetPageData: function (currentIndex) {
                    //alert(this.Form.zbCourseId);
                    this.formInline.model.sktid = this.Form.zbCourseId;
                    //alert(this.formInline.model.sktid);
                    GetPageData(this, currentIndex, '/api/ZB_CourseQuestions/GetList');

                    //////
                },
                //培训目标下拉
                ChangeOne: function () {
                    var mythis = this;
                    //alert(this.Form.zbCourseId);
                    console.log("oooooo", this.Form.zbCourseId);
                    var CourseId = this.Form.zbCourseId;
                    var url = '/api/ZB_Course/getChild?id=' + CourseId;
                    if (CourseId != null && CourseId != '') {
                        //alert(url);
                        myAjax("get", mythis, url, null, function (response) {
                            var ajaxModel = response.data;
                            //mythis.Form = ajaxModel;
                            //console.log("vvvvvv", ajaxModel);
                            mythis.Form.singleNumber = ajaxModel.mark04;
                            mythis.Form.multipleNumber = ajaxModel.mark05;
                            mythis.Form.judgmentNumber = ajaxModel.mark06;

                            mythis.Form.tsingleNumber = ajaxModel.mark04; //单选题_临时
                            mythis.Form.tmultipleNumber = ajaxModel.mark05;//多选题_临时
                            mythis.Form.tjudgmentNumber = ajaxModel.mark06;//判断题_临时
                            //console.log("UUUUUU", this);//此时this已不是vue对象了，是windows什么
                        }, false);

                        //alert(this.Form.tjudgmentNumber);
                    }

                    //////////////////////////////////////////////////////////////////////////
                },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                btnUpLoad: function () {
                    this.$message({
                        message: '上传成功',
                        type: 'success'
                    });
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.Form.zB_TrainPlanQuestions = [];//总部_培训计划考题_作废



                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            //alert(mythis.Form.zbCourseId);

                            var am = mythis.Form.trainingmode;//培训方式
                            var bm = mythis.Form.examinationmethods;//考试方式

                            var tb = mythis.Form.trainingdate.substring(0, 10);
                            var te = mythis.Form.endDate.substring(0, 10);

                            mythis.Form.year = mythis.Form.trainingdate.substring(0, 4);//取年

                            var d1 = mythis.Form.singleNumber
                            var d2 = mythis.Form.multipleNumber
                            var d3 = mythis.Form.judgmentNumber

                            var dd1 = mythis.Form.tsingleNumber; //单选题_临时
                            var dd2 = mythis.Form.tmultipleNumber;//多选题_临时
                            var dd3 = mythis.Form.tjudgmentNumber;//判断题_临时

                            //验证日期
                            //alert(tb);
                            //alert(te);
                            if (am != bm) {
                                showMessage('培训类型和考试方式保持一致，线上同为线上，线下同为线下！', 'error');
                                return false;
                            }

                            if (tb > te) {
                                showMessage('培训开始时间不能大于培训结束时间！', 'error');
                                return false;
                            }
                            //验证题数
                            if (d1 > dd1) {
                                showMessage('单选题不能大于题库数量！', 'error');
                                return false;
                            }
                            if (d2 > dd2) {
                                showMessage('多选题不能大于题库数量！', 'error');
                                return false;
                            }
                            if (d3 > dd3) {
                                showMessage('判断题不能大于题库数量！', 'error');
                                return false;
                            }

                            mythis.Form.state = 0;
                            onSubmitForm(this, '/api/ZB_TrainPlan/Save', mythis.Form);

                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                //
                getData: function () {
                    this.Form.mzbTrainPlanId = getUrlParam("id");
                    //alert(this.Form.mzbTrainPlanId);
                    //alert(this.Form.trainPlanQuestionidl);

                    getData(this, '/api/ZB_TrainPlan/get?id=' + this.id);
                    this.Form.fullmarks = this.Form.fullmarks + "";//满分
                    this.Form.qualificationscore = this.Form.qualificationscore + "";//合格分数
                    this.Form.singleNumber = this.Form.singleNumber + "";//单选题
                    this.Form.singleScore = this.Form.singleScore + "";//单选题每题分数
                    this.Form.multipleNumber = this.Form.multipleNumber + "";//多选题
                    this.Form.multipleScore = this.Form.multipleScore + "";//多选题每题分数
                    this.Form.judgmentNumber = this.Form.judgmentNumber + "";//判断题
                    this.Form.judgmentScore = this.Form.judgmentScore + "";//判断题每题分数

                    this.Form.tsingleNumber = this.Form.singleNumber; //单选题_临时
                    this.Form.tmultipleNumber = this.Form.multipleNumber;//多选题_临时
                    this.Form.tjudgmentNumber = this.Form.judgmentNumber; //判断题_临时
                    
                    if (!this.id) {
                        //this.Form.trainingteacher = "";  //讲师
                        this.Form.fullmarks = "100";  //满分
                        this.Form.qualificationscore = "60"; //合格分数
                    }
                    //1线上 2线下
                    if (this.Form.examinationmethods != "1") {
                        this.visible = false;
                    }
                    console.log("uuuuuu", this.Form);

                },
                //删除方法
                onDelete: function () { onDelete(this, '/api/ZB_TrainPlan/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //获取分页数据
                //GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/ZB_CourseQuestions/GetList') },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },

                //初始化获取课件名称
                getKJList: function () {
                    var mythis = this;
                    myAjax("post", mythis, '/api/ZB_Course/GetList', { model: {}, offset: 0, limit: 10 }, function (response) {
                        mythis.TrainingobjectivesL = response.data.pageData
                    });
                },
                //获取列表选择
                getKeyList: function () {
                    if (mythis.ListItem.tableMultipleSelection.length == 0) {
                        showMessage(msg.AtLeastOne, 'error')
                        return;
                    }

                    var delIds = [];
                    for (var i = 0; i < mythis.ListItem.tableMultipleSelection.length; i++) {
                        var item = mythis.ListItem.tableMultipleSelection[i];
                        delIds.push(item.id);
                    }
                    //this.formInline.model.selid = delIds;

                },
                //初始化获取课题数据
                getSTKeyL: function () {
                    var mythis = this;
                    //this.table.toggleRowSelection(this.data[2]);
                    // this.ListItem.tableData.toggleRowSelection(this.ListItem.tableData[2], true);
                    //this.ListItem.tableData.toggleRowSelection(item);
                    //this.Form.trainPlanQuestionidl=[];
                    //console.log("hhhhhhhhhhh", this.ListItem.tableMultipleSelection);
                    myAjax("post", mythis, '/api/ZB_TrainPlanQuestions/GetList', { model: {}, offset: 0, limit: 10 }, function (response) {
                        mythis.Form.trainPlanQuestionidl = response.data.pageData
                        for (var i = 0; i < response.data.pageData.length; i++) {

                            var item = response.data.pageData[i];
                            // this.table.toggleRowSelection(this.data[2]);


                            // var ZBCourseQuestionsId = item.id;

                            //this.ListItem.tableMultipleSelection.push({
                            //    id: ZBCourseQuestionsId,
                            //});
                            //this.Form.trainPlanQuestionidl.push({
                            //    id: ZBCourseQuestionsId,
                            //});
                        }
                        //console.log("ssssssssss", this.ListItem.tableMultipleSelection);
                        console.log("ssssssssss", this.ListItem.tableData);
                    });
                },
                //////////////////////////////////////////////////////////////////////////////
            },
            mounted: function () {

                //获取下拉菜单内容
                //this.Trainingtype = getDicData('w64'); //培训类型
                //this.Trainingobjectives = getDicData('17'); //培训目标
                //获取下拉菜单内容
                this.getKJList();//调用初始课件名称
                this.pageInitial = PageInitial(['zbkjglpxfs', 'zbkjgltx']);//培训方式、题型 初始化
                var dicDataList = this.pageInitial.dataDicList;
                this.TrainingtypeL = getDicDataFodDataList(dicDataList, 'zbkjglpxfs');//培训方式
                this.ExaminationmethodsL = getDicDataFodDataList(dicDataList, 'zbkjglpxfs');//考试方式
                this.QuestiontypeL = getDicDataFodDataList(dicDataList, 'zbkjgltx');//题型

                //初始化数据
                //列表高度自适应
                tablehigh(this);
                this.id = getUrlParam("id");
                this.getData();
                //this.GetPageData(1);

            }

        });
    </script>
</body>

</html>